Skip to content

Fix/e2e bug bash session graph project fixes - #13

Merged
Alex350-coder merged 11 commits into
mainfrom
fix/e2e-bug-bash-session-graph-project-fixes
Sep 8, 2026
Merged

Alex350-coder merged 11 commits into
mainfrom
fix/e2e-bug-bash-session-graph-project-fixes

Conversation

@Alex350-coder

Copy link
Copy Markdown
Owner

No description provided.

Alex350-coder and others added 11 commits September 6, 2026 23:08
Two requests expiring at the same time each independently triggered a
401-retry refresh. The refresh token is single-use and rotates
server-side, so the second concurrent call replayed an already-rotated
token, tripped reuse-detection, and revoked the whole session chain --
logging out a legitimately-authenticated user.

refreshAccessToken() now coalesces overlapping callers into a single
in-flight request, and is exported so other call sites can share it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
useBootstrapSession's hard-reload bootstrap ran its own raw fetch to
/api/auth/refresh instead of going through api-client's
refreshAccessToken(). Under React Strict Mode's double-effect-invoke
on mount (and in general, any overlapping caller), this raced a
second, independent refresh against the same single-use, rotating
refresh cookie -- the same root cause as BUG #1 -- and could revoke a
just-issued session.

Bootstrap now calls the shared, de-duped refreshAccessToken() (BUG #1)
instead of duplicating the refresh logic.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…(BUG #3)

setGraphData() always started with an empty visibility set, relying on
something else to progressively reveal nodes/edges over time. That's
correct for the Hero's scripted timeline, but interactive consumers
(the Workspace graph, the Report builder's node picker) have no
timeline script -- useGraphTimeline flips status to 'interactive'
synchronously on mount before setGraphData ever runs, so real data
loaded into the store stayed permanently hidden behind an empty
visibility set nothing would ever repopulate.

setGraphData() now reveals everything up front whenever status isn't
'playing', leaving the scripted Hero timeline's progressive reveal
untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n (BUG #4)

Creating a project whose slug collided with an existing project owned
by a different user crashed with a raw, unhandled 500 instead of the
intended 409 Conflict. isUniqueViolation() only checked error.code on
the top-level thrown error, but Drizzle ORM wraps the real pg driver
error (carrying the actual 23505 code) inside .cause on its
DrizzleQueryError -- the check never matched, so the unique-violation
escaped instead of being converted to ConflictError.

isUniqueViolation() now walks up to 5 levels of .cause looking for the
code, bounded to guard against any accidental cycle.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rId (BUG #5)

Project Settings -> Members listed each member only by their bare
userId UUID (e.g. e566b5cd-5f5c-498f-ac2e-c55bc4a45666), even though
members are invited by email -- an owner had no way to tell which UUID
corresponded to which teammate. ProjectMemberDto/ProjectMemberRow never
carried email or displayName: listByProject was a plain SELECT on
project_members with no join to users, and the mapper only forwarded
userId.

listByProject now joins project_members to users (ProjectMemberWithUserRow).
addOrAssignMember attaches the already-fetched targetUser's email/
displayName to the DTO it returns, with no extra query needed. Updated
the shared ProjectMemberDto, the frontend Zod schema, and MembersPanel's
row rendering (display name primary, email secondary, falls back to
email-only when no display name is set).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…isn't paginated in, and clear query cache on logout (BUG #6)

- ProjectSwitcher only searched the first page of useProjects() for the
  active project, silently showing "Select a project" for any project
  past that page even though it's a real, accessible project. It now
  falls back to fetching the project directly by id.
- useLogout() cleared the auth store but left the TanStack Query cache
  intact, so a different account logging in next in the same tab could
  briefly render the previous account's cached projects/graph data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…wn container (BUG #7)

WorkspaceGraphView's graph pane sizes purely from flex-grow (no explicit
CSS height anywhere up the chain to WorkspaceShell's min-h-screen), so
the Graph Engine's own h-full wrapper resolved to 0 and the graph
silently failed to render for any project that actually had data.
Wrapping it in a relative parent + absolute inset-0 sizes it against
the parent's laid-out box instead, which is reliable against a
flex-grown ancestor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ts it (BUG #8)

The server independently re-validates every scope entry's format
(FE-006) and can reject an entry the lenient client-side check let
through. ScopeEditor applied add/remove edits optimistically but never
rolled them back on mutation failure, so a rejected entry stayed
visible in the In scope / Excluded lists as if it were saved -- misleading
for a value that gates what the Orchestrator will let a tool run touch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… the user loads (BUG #9)

useBootstrapSession's effect depended on the reactive isAuthenticated
value. refreshAccessToken() flips accessToken (and therefore
isAuthenticated) as soon as it resolves, *before* /auth/me returns.
Because the effect depended on isAuthenticated, that flip re-ran it,
tearing down (cancelled = true) the in-flight bootstrap right as it
awaited /auth/me -- so setSession() never ran and the auth store's
user stayed null forever after every hard reload, even though
accessToken was set and all API calls kept working.

Every user-derived UI silently broke as a result: useCurrentRole()
always resolved to no role, hiding e.g. RunDetail's owner/admin-gated
'View raw output' button from a confirmed project owner.

The effect now reads accessToken via a direct store snapshot instead
of subscribing to it, and runs exactly once per mount so neither its
own side effects nor an unstable router reference can re-trigger it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…age (BUG #10)

ToolRun.error carries the orchestrator worker's failure detail
(typically { code, message }) but RunDetail never read it -- a failed
run showed only the red 'failed' badge with zero diagnostic
information, for every role. The value is typed z.unknown() end to
end, so it's parsed defensively with a local schema (never cast)
before being rendered; an unrecognized shape renders nothing extra
instead of crashing the page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
addEntry had no dedup check, so adding a value already present in
includes/excludes succeeded silently. This caused two problems:

1. Two <li key={entry}> elements shared the same React key, a real
   console error ("Encountered two children with the same key").
2. removeEntry's includes.filter((item) => item !== entry) matches by
   value, not by the specific instance clicked -- so clicking "Remove"
   on either one of the duplicate tags deleted BOTH at once. Verified
   live: adding "example.com" twice then removing one tag left "In
   scope: None." instead of one remaining entry.

Fixed by rejecting the add outright when the trimmed value already
exists in the target list, surfacing "This entry is already in the
list." the same way any other validation error is shown. This also
eliminates the key collision, since duplicates can no longer occur.
Verified live in the browser (Debug Test project): adding a duplicate
now shows the error and leaves the list untouched, and removing the
single remaining entry behaves correctly afterward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Alex350-coder
Alex350-coder merged commit 4142607 into main Sep 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant